package com.davinci.freemarket.dataModelLayer.model;

import java.sql.Date;
import java.util.ArrayList;

/**
 * 
 * @author Muma
 */
public class PublicationModel {

	public String title;
	public int category;
	public float price;
	public String details;

	public int usr_id;
	public Date timestamp;
	public String status;
	private int publication_id;
	
	private ArrayList<CommentModel> comments = new ArrayList<CommentModel>();
	
	/**
	 * Posibles valores son CRUD
	 * CREATION
	 * READ
	 * UPDATE
	 * DELETE
	 * 
	 * ver en StringStandarResourcesNames
	 */
	private String action_request = "CREATION";

	public PublicationModel() {
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public int getCategory() {
		return category;
	}

	public void setCategory(String category) throws NumberFormatException {
		this.category = Integer.parseInt(category);
	}

	public float getPrice() {
		return price;
	}

	public void setPrice(String price) throws NumberFormatException {
		this.price = Float.parseFloat(price);
	}

	public String getDetails() {
		return details;
	}

	public void setDetails(String details) {
		this.details = details;
	}

	public int getUsr_id() {
		return usr_id;
	}

	public void setUsr_id(String usr_id) throws NumberFormatException{
		this.usr_id = Integer.parseInt(usr_id);
	}

	public Date getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public void setPublication_id(int publication_id) {
		this.publication_id = publication_id;
	}

	public int getPublication_id() {
		return publication_id;
	}

	public String getPublicationId() {
		return Integer.toString(publication_id);
	}
	
	public void setAction_request(String action_request) {
		this.action_request = action_request;
	}

	public String getAction_request() {
		return action_request;
	}

	public void setComments(ArrayList<CommentModel> comments) {
		this.comments = comments;
	}

	public ArrayList<CommentModel> getComments() {
		return comments;
	}

}
